﻿@{
    ViewBag.Title = "ViewSong";
}

<h2>Song Details</h2>

@Html.Partial("Styles")
@Html.Partial("Script")

<div align="center" style="overflow:auto">
    <table style="height:200px">
      <col width="300px">
      <col width="300px">
      <col width="100px">
      <col width="100px">
      <col width="200px">
      <col width="150px">
      <col width="200px">
      <col width="200px">
      <col width="100px">
      <col width="100px">
    <tr>
      <td><b>Title</b></td> 
      <td><b>Artist</b></td>
      <td><b>Duration(s)</b></td>
      <td><b>Price</b></td>
      <td><b>ReleaseDate</b></td>
      <td><b>Genre</b></td>
      <td><b>Composer</b></td>
      <td><b>Lyricist</b></td>
    </tr>
    
        @for (int i = 0 ; i < 1 ; i ++)
        {
            string artist = "";
               <tr>
            <td>@ViewBag.song.Title</td>
            <td>
                @for (int k = 0; k < ViewBag.song.Artists.Count; k++)
                {
                    if (k == 0)
                    {
                        artist = ViewBag.song.Artists[k].Name;
                    }
                    else
                    {
                        artist = artist + " & " + ViewBag.song.Artists[k].Name;
                    }
                }
                @Html.Raw(artist)
            </td> 
            <td>@ViewBag.song.Duration</td>
            <td>$@ViewBag.song.Price</td>
            <td>@ViewBag.date</td>
            <td>@ViewBag.song.Genre</td>
            <td>@ViewBag.song.Composer</td>
            <td>@ViewBag.song.Lyricist</td>
            @if(ViewBag.type != "Y")
            {
                 <td> 
                    <label class="cartCheckBox">
                        <input type="checkbox" id="@ViewBag.song.ID" onclick="TransactionCart(@ViewBag.typeSong, @ViewBag.song.ID)"/>
                        <span></span>
                    </label>
                </td>
                <td> 
                    <label class="favCheckBox">
                        <input type="checkbox" id ="@("f" + ViewBag.song.ID)" onclick="FavouriteCart(@ViewBag.typeSong, @ViewBag.song.ID, @ViewBag.logged)"/>
                        <span></span>
                    </label>
                </td>
            }

            <td>&nbsp&nbsp</td>
        </tr>
        }
      
     
    
    </table>
</div>